package com.homeworkp8.Worker2Test;


//5.设计父类一员工类。子类：工人类，农民类，教师类，科学家类，服务生类
//（1）其中工人，农民，服务生只有基本工资  -->方法重写
//（2）科学家除基本工资外有年终奖  getter setter
//（3）教师除基本工资外有课酬（元/天）getter setter
//（4）编写一个测试类，将各种类型的员工的全年工资打印出来
public class Employee {
    private String name;
    private double dailySalary;
    private  int day;

    public Employee(String name, double dailySalary, int day) {
        this.name = name;

        this.dailySalary = dailySalary;
        this.day = day;
    }
    //getter 为了个性化重写的方法
    //setter 为了在主方法中设置个性化输入
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public double getDailySalary() {
        return dailySalary;
    }

    public void setDailySalary(double dailySalary) {
        this.dailySalary = dailySalary;
    }

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }

    //基本工资方法
    public void printSalary() {
        System.out.println(name +"的年薪为:\t" + dailySalary * day);
    }


}
